package com.stream.cloud.simple.service.service;

import com.stream.cloud.simple.service.model.UserEntity;
import com.stream.cloud.simple.service.repository.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yebaokang on 2017/10/31.
 */

@Service
@Transactional

//@CommonsLog // Creates log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);
//@Log //   Creates log = java.util.logging.Logger.getLogger(LogExample.class.getName());
//@Log4j //  Creates log = org.apache.log4j.Logger.getLogger(LogExample.class);
//@Log4j2 // Creates log = org.apache.logging.log4j.LogManager.getLogger(LogExample.class);
//@XSlf4j // Creates log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
//@Slf4j //  Creates log = org.slf4j.LoggerFactory.getLogger(LogExample.class);

@Slf4j
public class UserService {

    @SuppressWarnings("SpringJavaAutowiringInspection")
    @Autowired
    private UserRepository userRepository;

    public List<UserEntity> searchAll() {
        return userRepository.findAll();
    }
}
